package com.design.pattern.designPrinciples.openClose;

import java.math.BigDecimal;

/**
 * 对JavaCourse 进行扩展来实现课程优惠的场景
 * create by yufeng on 2021/7/3 00:17
 */
public class DiscountJavaCourse extends JavaCourse {
    public DiscountJavaCourse(String id, String name, BigDecimal price) {
        super(id, name, price);
    }

    public BigDecimal getDsicountPrice() {
        return super.getPrice().multiply(new BigDecimal(0.6));
    }
}
